﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DTO;
using DAL;
using System.Data;
using System.Data.Entity;

namespace BLL
{
    public class SampleFunc
    {
        GetData data = new GetData();
        UpdateData upData = new UpdateData();
      //  CRMEntities db = new CRMEntities();
        //public List<Sample> LoadListSample()
        //{

            ////CRMEntities db = new CRMEntities();
            //var query = (from sa in  db.sam
            //             orderby sa.ID
            //             select new Sample
            //             {
            //                 ID = sa.ID,
            //                 Sample_Code = sa.Sample_Code,
            //                 SampleName = sa.SampleName,
            //                 SampleLevel = sa.SampleLevel,
            //                 Description = sa.Description,
            //                 Parent_Code = sa.Parent_Code
            //             }).ToList();
            //return query;
      //  }

        public List<SampleEntity> LoadListSample()
        {
            return data.LoadListSample();
        }
        public void UpdateSample(SampleEntity _sample)
        {
            upData.UpdateSample(_sample);
            return;
        }

        public void AddSample(String _code, String _name, int _level, String _dct, int _pCode)
        {
            upData.AddSample(_code, _name, _level, _dct, _pCode);
            return;
            
        }
    }
}
